<link href="<?php echo base_url('resources') ?>/css/admin/styles.css" rel="stylesheet" type="text/css" />
<?php

?>
<div id="PeopleTableContainer"></div>
<div class="addRecord"></div>
<script type="text/javascript">

    $(document).ready(function() {

        //Prepare jTable
        $('#PeopleTableContainer').jtable({
            title: 'Danh sách ngày đặt cơm ',
            paging: true,
            pageSize: 17,
            pageSizeChangeArea: false,
            sorting: true,
            defaultSorting: 'NgayDatCom ASC',
            actions: {
                listAction: '<?php echo base_url('admin/order/getList'); ?>',
                deleteAction: '<?php echo base_url('admin/order/deleteDay'); ?>',
                createAction: '<?php echo base_url('admin/order/addDay'); ?>',
                updateAction: '<?php echo base_url('admin/order/updateDay'); ?>',
            },
            fields: {
                MaNgayDatCom: {
                    key: true,
                    create: false,
                    edit: false,
                    list: true,
                    title: 'Mã ngày đặt cơm',
                    width: '10%',
                    display: function(data) {
                        var $link = $('<a href="<?php echo base_url('admin/order/getDetail1?dayId='); ?>' + data.record.MaNgayDatCom + '" style="text-decoration: none;">' + data.record.MaNgayDatCom + '</a>');
                        return $link;
                    }
                },
                NgayDatCom: {
                    title: 'Ngày đặt cơm',
                    type: 'date',
                    width: '20%',
                    display: function(data) {
                        var $link = $('<a href="<?php echo base_url('admin/order/getDetail1?dayId='); ?>' + data.record.MaNgayDatCom + '" style="text-decoration: none;">' + data.record.NgayDatCom + '</a>');
                        return $link;
                    }

                },
                HanGioDatCom: {
                    title: 'Hạn giờ đặt cơm',
                   
                },                 
                
               
            },
        });

        //Load  list from server
        $('#PeopleTableContainer').jtable('load');
        $('.addRecord').addRecordButton;

    });



</script>